from django import forms
from django.contrib import admin
from ckeditor_uploader.widgets import CKEditorUploadingWidget

# Register your models here.
from .models import *

class questionAdminForm(forms.ModelForm):
    text  = forms.CharField(widget=CKEditorUploadingWidget(), label="Question")
    class Meta:
        model = question
        fields  =  '__all__'
        widgets = {
            'content': CKEditorUploadingWidget(),
        }

class questionAdmin(admin.ModelAdmin):
#    inlines  =  [questionImageInline]
    list_display  =  ('id',  'name', 'titel')
    list_display_links  = ('id',  'name')
    search_fields  =  ('id',  'name',  'question', 'titel')


class answerAdminForm(forms.ModelForm):
    text  = forms.CharField(widget=CKEditorUploadingWidget(), label="Answer")
    class Meta:
        model = answer
        fields  =  '__all__'
        widgets = {
            'content': CKEditorUploadingWidget(),
        }

class answerAdmin(admin.ModelAdmin):
#    inlines   =   [answerImageInline]
    list_display   = ('id',   'name', 'question')
    list_display_links    =   ('id',    'name')
    search_fields    =    ('id',    'name',    'answer', )

admin.site.register(question, questionAdmin)
admin.site.register(answer, answerAdmin)